package com.mhh.selary.backend.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 项目作用域(1:public 2:private)
 *
 * @author mhh
 * @date 2020-11-27 17:22:41
 */
@Getter
@AllArgsConstructor
public enum ProjectScopeEnum {

    /**
     *
     */
    PUBLIC(1, "公共的"),

    PRIVATE(2, "私有的"),
    ;

    private Integer scope;

    private String desc;

    public static ProjectScopeEnum valueBy(Integer scope) {
        return Arrays.stream(ProjectScopeEnum.values()).filter(enumItem -> enumItem.getScope().equals(scope)).findFirst().orElse(null);
    }
}
